package com.games.tankwar;

public class Tank {
/**
 * @Description:
 * @param
 * @return ${return_type}
 * @throws
 * @author YuFeng
 * @date 2020/3/19 23:10
 */
    private String tankID;
    private int positionX;
    private int positionY;

    //构造函数 alt + insert(也可以点鼠标右键选择Generate)
    public Tank(String tankID, int positionX, int positionY) {//string是字符串的意思
        this.tankID = tankID;
        this.positionX = positionX;
        this.positionY = positionY;
    }

    public void move(int x, int y) {
        System.out.println("坦克在向(" + x + "," + y + ")进发！");
    }

    //让坦克告知系统它的位置
    public String movelocation(){
        //获取坦克的当前位置输出
        int currentX=this.positionX;
        int currentY=this.positionY;
        return "坦克当前的位置为("+currentX+","+currentY+"),请领导检阅";
    }
}